/**
 * 
 */
package boardgame;

/**
 * This class is a template for all board pieces to be placed 
 * onto the board.  It's properties include the player who owns 
 * the piece and the position on the board.  Methods are available
 * to retrieve such properties and modify its position.  The 
 * validMove method is abstracted for specific game regulations
 * 
 * @author Wilson Cheong
 */
public abstract class Piece {	
			
	/**
	 * The player property is used to determine which player 
	 * owns the piece.  The integer value is the player id (i.e. 1 for player 1, 
	 * etc). A value of 0 means no one owns the piece.
	 */
	private int owner = 0;  //player id, 0 for no owner	
	
	/**
	 * Default constructor.  No functionality at this time.
	 * The piece is default with no owner and not in play.
	 */
	public Piece(){
		
	}
	
	/**
	 * Constructor to create a piece in play with an owner.
	 * This constructor allows a piece to be placed in 3D.
	 */
	public Piece(int owner){		
		this.owner = owner;
	}	
	
	/**
	 * Method which returns the owner of the Piece. 
	 * @return Returns the owner of the Piece.
	 */
	public int getOwner(){
		return owner;
	}
	
	/**
	 * Method to set the piece's new owner. 
	 * @param pl The player id of the Piece's new owner.
	 */
	public void setOwner(int owner){
		this.owner = owner;
	}		
	
	/**
	 * Method to determine whether or not a new position 
	 * is valid for the Piece.
	 * @return Returns Move.
	 */
	protected abstract Move makeMove();	
}
